package com.zmn.oms.admin.controller.purpose;

import com.zmn.oms.admin.controller.OmsBaseController;
import com.zmn.oms.business.interfaces.purpose.OrderPurposeBService;
import com.zmn.oms.common.dto.ResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.constraints.NotEmpty;


/**
 * 类描述: 意向单操作
 *
 * @author yangjiangming
 * @date 2019-04-30 15:17
 */
@Controller
@RequestMapping("/order/purpose/modify")
public class PurposeModifyController extends OmsBaseController {

    @Autowired
    private OrderPurposeBService orderPurposeBService;

    @RequestMapping("/sale")
    @ResponseBody
    public ResultDTO sale(@NotEmpty Integer orderPurposeId) {
        try {
            orderPurposeBService.updateOrderPurpose(orderPurposeId);
        } catch (Exception e) {
            return ResultDTO.fail("更新失败");
        }

        return ResultDTO.success();
    }
}
